package com.scu.hotelsystem.service;

import com.scu.hotelsystem.dao.RoomDao;
import com.scu.hotelsystem.pojo.Room;
import com.scu.hotelsystem.util.search.RoomSearch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class RoomServiceImpl implements RoomService {
    @Autowired
    private RoomDao roomDao;


    @Override
    public List<Room> searchRoomList(RoomSearch roomSearch, int index, int limit) {
        return roomDao.searchRoomList(roomSearch, index,limit);
    }

    @Override
    public int addRoom(Room room) {
        return roomDao.addRoom(room) ;
    }

    @Override
    public Room searchRoomById(int id) {
        return roomDao.searchRoomById(id);
    }

    @Override
    public int updateRoom(Room room) {
        return roomDao.updateRoom(room);
    }

    @Override
    public int deleteRoom(int[] idList) {
        return roomDao.deleteRoom(idList);
    }


}
